﻿using GWB.Core.Enum;
using GWB.Core.TableEntity.Common;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GWB.Core.TableEntity
{

    /// <summary>
    /// 集团租户
    /// </summary>
    [SugarTable("Sys_Tenant")]//当和数据库名称不一样可以设置表别名 指定表明
    public class Tenant : BaseEntity
    {
        /// <summary>
        /// 名字
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(20)", ColumnDescription = "名字", IsNullable = true)]
        public string Name { get; set; }

        /// <summary>
        /// 主机
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)", ColumnDescription = "主机", IsNullable = true)]
        public string Host { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)", ColumnDescription = "账号", IsNullable = true)]
        public string Account { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(300)", ColumnDescription = "备注", IsNullable = true)]
        public string Remarks { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [SugarColumn(ColumnDataType = "bit", ColumnDescription = "状态 0:禁用 1:启用", IsNullable = false)]
        public StateType State { get; set; } = StateType.Enable;


        /// <summary>
        /// 电话
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(32)", ColumnDescription = "电话", IsNullable = false)]
        public  string Phone { get; set; }

        
        /// <summary>
        /// 数据库连接
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(256)", ColumnDescription = "数据库连接", IsNullable = true)]
        public  string ConnectionString { get; set; }

        /// <summary>
        /// 有效期
        /// </summary>
        [SugarColumn(ColumnDataType = "DateTime", ColumnDescription = "有效期", IsNullable = true)]
        public DateTime? ExpirationTime { get; set; }
    }
}
